package com.tech.cloud.service.impl;

import com.tech.cloud.mapper.PaymentMapper;
import com.tech.cloud.po.PaymentPO;
import com.tech.cloud.service.PaymentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaymentServiceImpl implements PaymentService {
    @Resource
    private PaymentMapper paymentMapper;

    @Override
    public int add(PaymentPO pay) {
        return paymentMapper.insertSelective(pay);
    }

    @Override
    public int delete(Integer id) {
        return paymentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(PaymentPO pay) {
        return paymentMapper.updateByPrimaryKeySelective(pay);
    }

    @Override
    public PaymentPO getById(Integer id) {
        return paymentMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<PaymentPO> getAll() {
        return paymentMapper.selectAll();
    }
}
